public class PrintNumber implements Runnable{

    private int num;

    public PrintNumber() {
    }

    public PrintNumber(int num) {
        this.num = num;
    }

    @Override
    public void run() {
        for(int i = 0; i<num; i++){
            System.out.println(i);
//            Thread.yield();//当前线程执行到本句话时会让出cpu执行权
        }
    }
}
